#!/bin/bash

if [ -z $1 ];then
    echo "$0 <IO/SQL>"
    exit 22
fi

status=$(mysql -u root -pWWW.1.com -e "show slave status\G;" 2> /dev/null  | grep "Slave_$1_Running:"| awk -F: '{print $2}')
 
if [ $status == Yes ];then
    echo "1"
else 
    echo "0"
fi
